//----------------Sonic CD Menu Button Script-----------------//
//--------Scripted by Christian Whitehead 'The Taxman'--------//

// Aliases
#alias Object.Value0			:	Object.Timer
#alias Object.Value1			:	Object.ButtonXOffSet
#alias Object.Value2			:	Object.ButtonYOffSet
#alias Object.Value3			:	Object.ButtonLeaveXPos
#alias Object.Value4			:	Object.ButtonLeaveYPos
#alias Object.Value5			:	Object.ButtonYPos

// Object[1] is a blank object just to share values
#alias Object[1].Value1 		:	Object.RecenterValue
#alias Object[1].Value2			:	Object.ButtonCount
#alias Object[1].Value3 		:	Object.DragLimit

// MenuHeading Aliases
#alias Object[33].State			:	MenuHeading.State
#alias Object[33].PropertyValue	:	MenuHeading.Header

// Object[-1] and [+1] are MenuButton's
#alias Object[-1].State			:	PrevMenuButton.State
#alias Object[+1].State			:	NextMenuButton.State

// MenuControl Aliases
#alias Object[0].State			:	MenuControl.State
#alias Object[0].Value0			:	MenuControl.Fade
#alias Object[0].Value1			:	MenuControl.ButtonYOffset
#alias Object[0].Value2			:	MenuControl.CurrentDrag
#alias Object[0].Value3			:	MenuControl.CurrentSelection
#alias Object[0].Value7			:	MenuControl.SmoothDrag

// MenuWindow Aliases
#alias Object[61].State			:	MenuWindow.State
#alias Object[61].XPos			:	MenuWindow.XPos
#alias Object[61].YPos			:	MenuWindow.YPos
#alias Object[61].Value1		:	MenuWindow.BaseWidth
#alias Object[61].Value2		:	MenuWindow.BaseHeight
#alias Object[61].Value3		:	MenuWindow.BaseXOffset
#alias Object[61].Value4		:	MenuWindow.BaseYOffset
#alias Object[61].Value5		:	MenuWindow.EntityPos

// Object[62] is whatever next menu is this object going to be set into
#alias Object[62].InkEffect		:	Object.NextMenuInkEffect
#alias Object[62].Alpha			:	Object.NextMenuAlpha

// States
#alias 0	:	MENUBUTTON_DELAY
#alias 1	:	MENUBUTTON_BUTTONS_IN
#alias 2	:	MENUBUTTON_CONFIRM_SELECTION
#alias 3	:	MENUBUTTON_MENU_SELECTED
#alias 4	:	MENUBUTTON_BUTTONS_OUT
#alias 5	:	MENUBUTTON_BLANK
#alias 6	:	MENUBUTTON_BLANK2
#alias 7	:	MENUBUTTON_RESET

// Menu Control States
#alias 2	:	MENUCONTROL_CONTROLS
#alias 3	:	MENUCONTROL_BLANK
#alias 4	:	MENUCONTROL_ENTER_TIMEATTACK
#alias 5	:	MENUCONTROL_ENTER_DEMO
#alias 7	:	MENUCONTROL_ENTER_TROPHIES
#alias 8	:	MENUCONTROL_ENTER_LEADERBOARDS

// Menu Window States
#alias 5	:	MENUWINDOW_SOUNDTRACK_EXPAND
#alias 7	:	MENUWINDOW_MODSETTINGS_EXPAND

// Menu Heading States
#alias 0	:	MENUHEADING_IDLE
#alias 1	:	MENUHEADING_LEAVE_SCREEN
#alias 2	:	MENUHEADING_ENTER_SCREEN

// Menu Heading Property Values
#alias 5	:	MAINMENU_HEADER
#alias 6	:	SAVESELECT_HEADER
#alias 7	:	HELP&OPTIONS_HEADER
#alias 8	:	EXTRAS_HEADER
#alias 9	:	SOUNDTRACK_HEADER
#alias 10	:	STAGESELECT_HEADER
#alias 11	:	MODSETTINGS_HEADER

// Menus
#alias 1 	:	Menu_LoadSaveMenu
#alias 2 	:	Menu_TimeAttack
#alias 3 	:	Menu_Achievements
#alias 4 	:	Menu_LeaderBoards
#alias 5 	:	Menu_Help&Options
#alias 6 	:	Menu_Extras
#alias 7 	:	Menu_UnlockFullGame
#alias 8 	:	Menu_Store
#alias 9 	:	Menu_Exit
#alias 10	:	Menu_Soundtrack
#alias 11	:	Menu_MoreGames
#alias 12	:	Menu_ModSettings

// Ink Effects
#alias 2	:	INK_ALPHA

// Priority
#alias 1	:	PRIORITY_ACTIVE

// Game Mode Aliases
#alias 0	:	MODE_NOSAVE

// Languages
#alias 0	:	LANG_ENGLISH
#alias 1	:	LANG_FRENCH
#alias 2	:	LANG_ITALIAN
#alias 3	:	LANG_DEUTSCH
#alias 4	:	LANG_SPANISH
#alias 5	:	LANG_JAPANESE

// Global SFX
#alias 27	:	SFX_G_SELECT

// Engine & Callbacks
#alias 3	:	ENGINE_EXITGAME
#alias 5 	:	CALLBACK_RETURNSTORE_SELECTED
#alias 7 	:	CALLBACK_EXIT_SELECTED
#alias 8 	:	CALLBACK_BUY_FULL_GAME_SELECTED
#alias 14	:	CALLBACK_FULL_VERSION_ONLY
#alias 16	:	CALLBACK_MOREGAMES

// Online Menus
#alias 0	:	ONLINEMENU_ACHIEVEMENTS
#alias 1	:	ONLINEMENU_LEADERBOARDS

// game.mainMenuMode Aliases
#alias 0	:	MAINMENUMODE_NONE		// Starts with this, but gets swapped on MenuButton


// Function declarations
#function MenuButton_SetupMenuWindow

function MenuButton_SetupMenuWindow
	ResetObjectEntity(61, TypeName[Menu Window], 0, Object.XPos, Object.YPos)
	MenuWindow.XPos		  += 0x480000
	MenuWindow.BaseWidth   = 144
	MenuWindow.BaseHeight  = 21
	MenuWindow.BaseXOffset = MenuWindow.XPos
	MenuWindow.BaseYOffset = MenuWindow.YPos
	MenuWindow.EntityPos   = Object.EntityNo
end function


sub ObjectMain
	Object.ButtonYOffSet  = Object.ButtonYPos
	Object.ButtonYOffSet--
	Object.ButtonYOffSet *= 60
	Object.ButtonYOffSet += MenuControl.ButtonYOffset

	TempValue0  = Screen.CenterX
	TempValue0 -= 160
	
	Object.ButtonXOffSet  = Object.ButtonYOffSet
	Object.ButtonXOffSet *= 54
	Object.ButtonXOffSet /= 60
	Object.ButtonXOffSet -= 16
	Object.ButtonXOffSet += TempValue0

	switch Object.State
	case MENUBUTTON_DELAY
		if Object.Timer < 60
			Object.Timer++
		else
			Object.Timer = 0
			Object.State++
		end if
		break

	case MENUBUTTON_BUTTONS_IN
		TempValue0   = Object.ButtonXOffSet
		TempValue0 <<= 16
		TempValue0  -= Object.XPos
		TempValue0 >>= 4
		Object.XPos += TempValue0

		TempValue0   = Object.ButtonYOffSet
		TempValue0 <<= 16
		TempValue0  -= Object.YPos
		TempValue0 >>= 4
		Object.YPos += TempValue0

		if Object.Timer < 80
			Object.Timer++
		else
			Object.Timer = 0
			Object.State++
		end if
		break

	case MENUBUTTON_CONFIRM_SELECTION
		Object.XPos   = Object.ButtonXOffSet
		Object.XPos <<= 16

		Object.YPos   = Object.ButtonYOffSet
		Object.YPos <<= 16

	// Originally if Options.PhysicalControls == false
	// Adapted the code to ensure compatibility with Blit Data files
#platform: Standard
		CheckResult = false
#endplatform

#platform: Mobile
		CheckEqual(Options.PhysicalControls, false)
#endplatform

#platform: Use_Origins
		CheckEqual(Options.PhysicalControls, false)
#endplatform

		if CheckResult == true
			TempValue0  = Object.ButtonXOffSet
			TempValue0 -= 16
			TempValue1  = Object.ButtonXOffSet
			TempValue1 += 176
			TempValue2  = Object.ButtonYOffSet
			TempValue2 -= 20
			TempValue3  = Object.ButtonYOffSet
			TempValue3 += 20
			CheckTouchRect(TempValue0, TempValue2, TempValue1, TempValue3)
			if CheckResult > -1
				TempValue0   = MenuControl.SmoothDrag
				TempValue0 >>= 2
				if TempValue0 == 0
					if Object.RecenterValue == 0
						MenuControl.CurrentDrag = Object.ButtonYPos
					end if
				end if
			else
				CheckTouchRect(0, 0, Screen.XSize, Screen.YSize)
				if CheckResult < 0
					if MenuControl.CurrentDrag == Object.ButtonYPos
						if Object.RecenterValue == 0
							PlaySfx(SFX_G_SELECT, false)
							MenuControl.State = MENUCONTROL_BLANK
							switch Object.PropertyValue
							case Menu_LoadSaveMenu
							case Menu_Help&Options
							case Menu_Extras
							case Menu_Soundtrack		//All of this is MenuButton
							case Menu_ModSettings
								Object[34].State = MENUBUTTON_BUTTONS_OUT
								Object[34].Timer = 0
								Object[35].State = MENUBUTTON_BUTTONS_OUT
								Object[35].Timer = 0
								Object[36].State = MENUBUTTON_BUTTONS_OUT
								Object[36].Timer = 0
								Object[37].State = MENUBUTTON_BUTTONS_OUT
								Object[37].Timer = 0
								Object[38].State = MENUBUTTON_BUTTONS_OUT
								Object[38].Timer = 0
								Object[39].State = MENUBUTTON_BUTTONS_OUT
								Object[39].Timer = 0
								Object[40].State = MENUBUTTON_BUTTONS_OUT
								Object[40].Timer = 0
								Object[41].State = MENUBUTTON_BUTTONS_OUT
								Object[41].Timer = 0
								Object[42].State = MENUBUTTON_BUTTONS_OUT
								Object[42].Timer = 0
								Object[43].State = MENUBUTTON_BUTTONS_OUT
								Object[43].Timer = 0
								Object[44].State = MENUBUTTON_BUTTONS_OUT
								Object[44].Timer = 0
								break

							case Menu_TimeAttack
								if Engine.TrialMode == false
									StopMusic()
									Object[34].State = MENUBUTTON_BUTTONS_OUT
									Object[34].Timer = 0
									Object[35].State = MENUBUTTON_BUTTONS_OUT
									Object[35].Timer = 0
									Object[36].State = MENUBUTTON_BUTTONS_OUT
									Object[36].Timer = 0
									Object[37].State = MENUBUTTON_BUTTONS_OUT
									Object[37].Timer = 0
									Object[38].State = MENUBUTTON_BUTTONS_OUT
									Object[38].Timer = 0
									Object[39].State = MENUBUTTON_BUTTONS_OUT
									Object[39].Timer = 0
									Object[40].State = MENUBUTTON_BUTTONS_OUT
									Object[40].Timer = 0
									Object[41].State = MENUBUTTON_BUTTONS_OUT
									Object[41].Timer = 0
									Object[42].State = MENUBUTTON_BUTTONS_OUT
									Object[42].Timer = 0
									Object[43].State = MENUBUTTON_BUTTONS_OUT
									Object[43].Timer = 0
									Object[44].State = MENUBUTTON_BUTTONS_OUT
									Object[44].Timer = 0
								end if
								break

							end switch

							Object.State = MENUBUTTON_MENU_SELECTED
						end if
					end if
				else
					if MenuControl.CurrentDrag == Object.ButtonYPos
						MenuControl.CurrentDrag = 0
					end if
				end if
			end if
		else
			if Object.ButtonYPos == MenuControl.CurrentSelection
				CheckResult = false
				if KeyPress[0].Start == true
					CheckResult = true
				end if

				if KeyPress[0].ButtonA == true
					CheckResult = true
				end if

				if Object.PropertyValue == Menu_Achievements
					if Engine.OnlineActive == false
						CheckResult = false
					end if
				end if

				if CheckResult == true
					PlaySfx(SFX_G_SELECT, false)
					if Engine.TrialMode == true
						if Engine.PlatformID != RETRO_ANDROID
							if Object.PropertyValue == Menu_LoadSaveMenu
								StopMusic()
							end if
						end if
					else
						if Object.PropertyValue == Menu_TimeAttack
							StopMusic()
						end if
					end if

					MenuControl.State = MENUCONTROL_BLANK
					switch Object.PropertyValue
					case Menu_LoadSaveMenu
					case Menu_Help&Options
					case Menu_Extras
					case Menu_Soundtrack
					case Menu_ModSettings
						Object[34].State = MENUBUTTON_BUTTONS_OUT
						Object[34].Timer = 0
						Object[35].State = MENUBUTTON_BUTTONS_OUT
						Object[35].Timer = 0
						Object[36].State = MENUBUTTON_BUTTONS_OUT
						Object[36].Timer = 0
						Object[37].State = MENUBUTTON_BUTTONS_OUT
						Object[37].Timer = 0
						Object[38].State = MENUBUTTON_BUTTONS_OUT
						Object[38].Timer = 0
						Object[39].State = MENUBUTTON_BUTTONS_OUT
						Object[39].Timer = 0
						Object[40].State = MENUBUTTON_BUTTONS_OUT
						Object[40].Timer = 0
						Object[41].State = MENUBUTTON_BUTTONS_OUT
						Object[41].Timer = 0
						Object[42].State = MENUBUTTON_BUTTONS_OUT
						Object[42].Timer = 0
						Object[43].State = MENUBUTTON_BUTTONS_OUT
						Object[43].Timer = 0
						Object[44].State = MENUBUTTON_BUTTONS_OUT
						Object[44].Timer = 0
						break

					case Menu_TimeAttack
						if Engine.TrialMode == false
							Object[34].State = MENUBUTTON_BUTTONS_OUT
							Object[34].Timer = 0
							Object[35].State = MENUBUTTON_BUTTONS_OUT
							Object[35].Timer = 0
							Object[36].State = MENUBUTTON_BUTTONS_OUT
							Object[36].Timer = 0
							Object[37].State = MENUBUTTON_BUTTONS_OUT
							Object[37].Timer = 0
							Object[38].State = MENUBUTTON_BUTTONS_OUT
							Object[38].Timer = 0
							Object[39].State = MENUBUTTON_BUTTONS_OUT
							Object[39].Timer = 0
							Object[40].State = MENUBUTTON_BUTTONS_OUT
							Object[40].Timer = 0
							Object[41].State = MENUBUTTON_BUTTONS_OUT
							Object[41].Timer = 0
							Object[42].State = MENUBUTTON_BUTTONS_OUT
							Object[42].Timer = 0
							Object[43].State = MENUBUTTON_BUTTONS_OUT
							Object[43].Timer = 0
							Object[44].State = MENUBUTTON_BUTTONS_OUT
							Object[44].Timer = 0
						end if
						break

					end switch

					Object.State = MENUBUTTON_MENU_SELECTED
				end if
			end if
		end if

		if Engine.PlatformID == RETRO_WP7
			if KeyPress[0].ButtonB == true
				EngineCallback(CALLBACK_EXIT_SELECTED)
				Object.State = MENUBUTTON_CONFIRM_SELECTION

				MenuControl.State		= MENUCONTROL_CONTROLS
				MenuControl.CurrentDrag = 0
			end if
		end if
		break

	case MENUBUTTON_MENU_SELECTED
		if Object.Timer < 30
			Object.Timer++
		else
			Object.Timer = 0
			switch Object.PropertyValue
			case Menu_LoadSaveMenu
				if Engine.TrialMode == false
					MenuHeading.State  = MENUHEADING_LEAVE_SCREEN
					MenuHeading.Header = SAVESELECT_HEADER

					CallFunction(MenuButton_SetupMenuWindow)
					ResetObjectEntity(62, TypeName[Load Save Menu], 0, 0, 0)

					Object.NextMenuInkEffect = INK_ALPHA
					Object.NextMenuAlpha	 = 0
					
					ResetObjectEntity(63, TypeName[Blank Object], 0, 0, 0)
					ResetObjectEntity(64, TypeName[Blank Object], 0, 0, 0)
					ResetObjectEntity(65, TypeName[Blank Object], 0, 0, 0)
					ResetObjectEntity(66, TypeName[Blank Object], 0, 0, 0)
					Object.Type = TypeName[Blank Object]
					ReadSaveRAM()
				else
#platform: Standard
					Object.State = MENUBUTTON_BLANK
					MenuControl.State	= MENUCONTROL_ENTER_DEMO
					MenuControl.Fade 	= 0

					Options.GameMode		 = MODE_NOSAVE
					Player.Score			 = 0
					Player.Lives			 = 3
					Player.ScoreBonus		 = 50000
					Transporter_Destroyed	 = false
					MetalSonic_Destroyed	 = false
					Good_Future				 = false
#endplatform

#platform: Mobile
					MenuHeading.State  = MENUHEADING_LEAVE_SCREEN
					MenuHeading.Header = STAGESELECT_HEADER

					CallFunction(MenuButton_SetupMenuWindow)
					MenuWindow.State = MENUWINDOW_SOUNDTRACK_EXPAND
					ResetObjectEntity(62, TypeName[Demo Menu], 0, 0, 0)

					Object.NextMenuInkEffect = INK_ALPHA
					Object.NextMenuAlpha	 = 0

					ResetObjectEntity(63, TypeName[Blank Object], 0, 0, 0)
					ResetObjectEntity(64, TypeName[Blank Object], 0, 0, 0)
					ResetObjectEntity(65, TypeName[Blank Object], 0, 0, 0)
					ResetObjectEntity(66, TypeName[Blank Object], 0, 0, 0)
					Object.Type = TypeName[Blank Object]
					ReadSaveRAM()
#endplatform
				end if
				break

			case Menu_TimeAttack
				if Engine.TrialMode == false
					Object.State = MENUBUTTON_BLANK

					MenuControl.State = MENUCONTROL_ENTER_TIMEATTACK
					MenuControl.Fade  = 0
				else
					Object.State = MENUBUTTON_CONFIRM_SELECTION

					MenuControl.State = MENUCONTROL_CONTROLS
					EngineCallback(CALLBACK_FULL_VERSION_ONLY)
#platform: Mobile
					MenuControl.CurrentDrag = 0
#endplatform
				end if
				break

			case Menu_Achievements
				if Engine.PlatformID != RETRO_WP7
					LoadOnlineMenu(ONLINEMENU_ACHIEVEMENTS)
					Object.State = MENUBUTTON_CONFIRM_SELECTION

					MenuControl.State = MENUCONTROL_CONTROLS
#platform: Mobile
					MenuControl.CurrentDrag = 0
#endplatform
				else
					Object.State   = MENUBUTTON_BLANK

					MenuControl.State = MENUCONTROL_ENTER_TROPHIES
					MenuControl.Fade  = 0
				end if
				break

			case Menu_LeaderBoards
				if Engine.PlatformID != RETRO_WP7
					LoadOnlineMenu(ONLINEMENU_LEADERBOARDS)
					Object.State   = MENUBUTTON_CONFIRM_SELECTION

					MenuControl.State = MENUCONTROL_CONTROLS
#platform: Mobile
					MenuControl.CurrentDrag = 0
#endplatform
				else
					if Engine.TrialMode == false
						Object.State   = MENUBUTTON_BLANK

						MenuControl.State = MENUCONTROL_ENTER_LEADERBOARDS
						MenuControl.Fade  = 0
					else
						Object.State  = MENUBUTTON_CONFIRM_SELECTION

						MenuControl.State = MENUCONTROL_CONTROLS
						EngineCallback(CALLBACK_FULL_VERSION_ONLY)
					end if
				end if
				break

			case Menu_Help&Options
				MenuHeading.State  = MENUHEADING_LEAVE_SCREEN
				MenuHeading.Header = HELP&OPTIONS_HEADER

				CallFunction(MenuButton_SetupMenuWindow)
#platform: Use_Standalone
	#platform: Standard
				ResetObjectEntity(62, TypeName[Options Menu C], 0, 0, 0)
	#endplatform

	#platform: Mobile
				if Options.HapticsMenu == true
					ResetObjectEntity(62, TypeName[Options Menu H], 0, 0, 0)
				else
					ResetObjectEntity(62, TypeName[Options Menu], 0, 0, 0)
				end if
	#endplatform
#endplatform

#platform: Use_Origins
				if Options.DevMenuFlag == true
					ResetObjectEntity(62, TypeName[Options Menu H], 0, 0, 0)
				else
					ResetObjectEntity(62, TypeName[Options Menu], 0, 0, 0)
				end if
#endplatform

				Object.NextMenuInkEffect = INK_ALPHA
				Object.NextMenuAlpha	 = 0

				ResetObjectEntity(63, TypeName[Blank Object], 0, 0, 0)
				ResetObjectEntity(64, TypeName[Blank Object], 0, 0, 0)
				ResetObjectEntity(65, TypeName[Blank Object], 0, 0, 0)
				ResetObjectEntity(66, TypeName[Blank Object], 0, 0, 0)
				Object.Type = TypeName[Blank Object]
				break

			case Menu_Extras
				MenuHeading.State  = MENUHEADING_LEAVE_SCREEN
				MenuHeading.Header = EXTRAS_HEADER

				CallFunction(MenuButton_SetupMenuWindow)
				ResetObjectEntity(62, TypeName[Extras Menu], 0, 0, 0)

				Object.NextMenuInkEffect = INK_ALPHA
				Object.NextMenuAlpha	 = 0

				ResetObjectEntity(63, TypeName[Blank Object], 0, 0, 0)
				ResetObjectEntity(64, TypeName[Blank Object], 0, 0, 0)
				ResetObjectEntity(65, TypeName[Blank Object], 0, 0, 0)
				ResetObjectEntity(66, TypeName[Blank Object], 0, 0, 0)
				Object.Type = TypeName[Blank Object]
				break

			case Menu_UnlockFullGame
				EngineCallback(CALLBACK_BUY_FULL_GAME_SELECTED)
				Object.State = MENUBUTTON_CONFIRM_SELECTION

				MenuControl.State = MENUCONTROL_CONTROLS
#platform: Mobile
				MenuControl.CurrentDrag = 0
#endplatform
				break

			case Menu_Store
				EngineCallback(CALLBACK_RETURNSTORE_SELECTED)
				Object.State = MENUBUTTON_CONFIRM_SELECTION

				MenuControl.State = MENUCONTROL_CONTROLS
#platform: Mobile
				MenuControl.CurrentDrag = 0
#endplatform
				break

			case Menu_Exit
				EngineCallback(CALLBACK_EXIT_SELECTED)
#platform: Use_Decomp
				Engine.State = ENGINE_EXITGAME
#endplatform
				Object.State = MENUBUTTON_CONFIRM_SELECTION

				MenuControl.State = MENUCONTROL_CONTROLS
#platform: Mobile
				MenuControl.CurrentDrag = 0
#endplatform
				break

			case Menu_Soundtrack
				MenuHeading.State  = MENUHEADING_LEAVE_SCREEN
				MenuHeading.Header = SOUNDTRACK_HEADER

				CallFunction(MenuButton_SetupMenuWindow)
				MenuWindow.State = MENUWINDOW_SOUNDTRACK_EXPAND
				ResetObjectEntity(62, TypeName[Soundtrack Menu], 0, 0, 0)

				Object.NextMenuInkEffect = INK_ALPHA
				Object.NextMenuAlpha 	 = 0

				ResetObjectEntity(63, TypeName[Blank Object], 0, 0, 0)
				ResetObjectEntity(64, TypeName[Blank Object], 0, 0, 0)
				ResetObjectEntity(65, TypeName[Blank Object], 0, 0, 0)
				ResetObjectEntity(66, TypeName[Blank Object], 0, 0, 0)
				Object.Type = TypeName[Blank Object]
				break

#platform: Mobile
			case Menu_MoreGames
				EngineCallback(CALLBACK_MOREGAMES)
				Object.State = MENUBUTTON_CONFIRM_SELECTION

				MenuControl.State		= MENUCONTROL_CONTROLS
				MenuControl.CurrentDrag = 0
				break
#endplatform

			case Menu_ModSettings
				MenuHeading.State  = MENUHEADING_LEAVE_SCREEN
				MenuHeading.Header = MODSETTINGS_HEADER

				CallFunction(MenuButton_SetupMenuWindow)
				ResetObjectEntity(62, TypeName[Mod Settings Menu], 0, 0, 0)

				Object.NextMenuInkEffect = INK_ALPHA
				Object.NextMenuAlpha	 = 0

				ResetObjectEntity(63, TypeName[Blank Object], 0, 0, 0)
				ResetObjectEntity(64, TypeName[Blank Object], 0, 0, 0)
				ResetObjectEntity(65, TypeName[Blank Object], 0, 0, 0)
				ResetObjectEntity(66, TypeName[Blank Object], 0, 0, 0)
				Object.Type = TypeName[Blank Object]
				break
			end switch
		end if
		break

	case MENUBUTTON_BUTTONS_OUT
		TempValue0   = Object.ButtonLeaveXPos
		TempValue0  -= Object.XPos
		TempValue0 >>= 4
		Object.XPos += TempValue0

		TempValue0   = Object.ButtonLeaveYPos
		TempValue0  -= Object.YPos
		TempValue0 >>= 4
		Object.YPos += TempValue0

		if Object.Timer < 80
			Object.Timer++
		else
			Object.Timer = 0
			Object.State = MENUBUTTON_BLANK2
		end if
		break

	case MENUBUTTON_BLANK
	case MENUBUTTON_BLANK2
		// Nothing happens here
		break

	case MENUBUTTON_RESET	// Used by MenuWindow
		if Object.PropertyValue == Menu_Extras
			if PrevMenuButton.State == MENUBUTTON_CONFIRM_SELECTION
				Object.State = MENUBUTTON_CONFIRM_SELECTION

				MenuControl.State = MENUCONTROL_CONTROLS
#platform: Mobile
				MenuControl.CurrentDrag = 0
#endplatform
			end if
		else
			if NextMenuButton.State == MENUBUTTON_CONFIRM_SELECTION
				Object.State = MENUBUTTON_CONFIRM_SELECTION

				MenuControl.State = MENUCONTROL_CONTROLS
#platform: Mobile
				MenuControl.CurrentDrag = 0
#endplatform
			end if
		end if
		break

	end switch
end sub


sub ObjectDraw
	DrawSprite(0)
	switch Object.State
	case MENUBUTTON_DELAY
	case MENUBUTTON_BUTTONS_IN
	case MENUBUTTON_CONFIRM_SELECTION
	case MENUBUTTON_BUTTONS_OUT
	case MENUBUTTON_BLANK
	case MENUBUTTON_RESET
		if Object.ButtonYPos == MenuControl.CurrentSelection
			TempValue0  = Object.PropertyValue
			TempValue0 += 12
			DrawSprite(TempValue0)
		else
			DrawSprite(Object.PropertyValue)
		end if
		break

	case MENUBUTTON_MENU_SELECTED
		TempValue0   = Object.Timer
		TempValue0  &= 3
		TempValue0 >>= 1
		if TempValue0 == 0
			TempValue0  = Object.PropertyValue
			TempValue0 += 12

			DrawSprite(TempValue0)
		end if
		break

	end switch
end sub


sub ObjectStartup
	switch Engine.Language
	case LANG_ENGLISH
		LoadSpriteSheet("Menu/MenuGfx2_EN.gif")
		break
	case LANG_FRENCH
		LoadSpriteSheet("Menu/MenuGfx2_FR.gif")
		break
	case LANG_ITALIAN
		LoadSpriteSheet("Menu/MenuGfx2_IT.gif")
		break
	case LANG_DEUTSCH
		LoadSpriteSheet("Menu/MenuGfx2_DE.gif")
		break
	case LANG_SPANISH
		LoadSpriteSheet("Menu/MenuGfx2_ES.gif")
		break
	case LANG_JAPANESE
		LoadSpriteSheet("Menu/MenuGfx2_JP.gif")
		break
	end switch

	Object.ButtonCount = 1
	ArrayPos0 = 32
	while ArrayPos0 < 1056
		if Object[ArrayPos0].Type == TypeName[Menu Button]
			Object[ArrayPos0].Priority		  = PRIORITY_ACTIVE
			Object[ArrayPos0].ButtonLeaveXPos = Object[ArrayPos0].XPos
			Object[ArrayPos0].ButtonLeaveYPos = Object[ArrayPos0].ButtonLeaveYPos
		end if
		ArrayPos0++
	loop

	switch Engine.PlatformID
	case RETRO_WIN
	case RETRO_OSX
		if Options.DevMenuFlag == true
			Object[34].PropertyValue = Menu_LoadSaveMenu
			Object[35].PropertyValue = Menu_ModSettings
			Object[36].PropertyValue = Menu_TimeAttack
			Object[37].PropertyValue = Menu_Help&Options
			Object[38].PropertyValue = Menu_Soundtrack
			Object[39].PropertyValue = Menu_Extras
			Object[40].PropertyValue = Menu_Exit
			Object.ButtonCount = 7
		else
			if Engine.TrialMode == true
				Object[34].PropertyValue = Menu_LoadSaveMenu
				Object[35].PropertyValue = Menu_ModSettings
				Object[36].PropertyValue = Menu_TimeAttack
				Object[37].PropertyValue = Menu_Achievements
				Object[38].PropertyValue = Menu_LeaderBoards
				Object[39].PropertyValue = Menu_Help&Options
				Object[40].PropertyValue = Menu_Soundtrack
				Object[41].PropertyValue = Menu_UnlockFullGame
				Object[42].PropertyValue = Menu_Exit
				Object.ButtonCount = 9
			else
				Object[34].PropertyValue = Menu_LoadSaveMenu
				Object[35].PropertyValue = Menu_ModSettings
				Object[36].PropertyValue = Menu_TimeAttack
				Object[37].PropertyValue = Menu_Achievements
				Object[38].PropertyValue = Menu_LeaderBoards
				Object[39].PropertyValue = Menu_Help&Options
				Object[40].PropertyValue = Menu_Soundtrack
				Object[41].PropertyValue = Menu_Extras
				Object[42].PropertyValue = Menu_Exit
				Object.ButtonCount = 9
			end if
		end if
		break

	case RETRO_XBOX_360
		if Engine.TrialMode == true
			Object[34].PropertyValue = Menu_LoadSaveMenu
			Object[35].PropertyValue = Menu_ModSettings
			Object[36].PropertyValue = Menu_TimeAttack
			Object[37].PropertyValue = Menu_Achievements
			Object[38].PropertyValue = Menu_LeaderBoards
			Object[39].PropertyValue = Menu_Help&Options
			Object[40].PropertyValue = Menu_Soundtrack
			Object[41].PropertyValue = Menu_UnlockFullGame
			Object[42].PropertyValue = Menu_Exit
			Object.ButtonCount = 9
		else
			Object[34].PropertyValue = Menu_LoadSaveMenu
			Object[35].PropertyValue = Menu_ModSettings
			Object[36].PropertyValue = Menu_TimeAttack
			Object[37].PropertyValue = Menu_Achievements
			Object[38].PropertyValue = Menu_LeaderBoards
			Object[39].PropertyValue = Menu_Help&Options
			Object[40].PropertyValue = Menu_Soundtrack
			Object[41].PropertyValue = Menu_Extras
			Object[42].PropertyValue = Menu_Exit
			Object.ButtonCount = 9
		end if
		break

	case RETRO_PS3
		if Engine.TrialMode == true			
			Object[34].PropertyValue = Menu_LoadSaveMenu
			Object[35].PropertyValue = Menu_ModSettings
			Object[36].PropertyValue = Menu_TimeAttack
			Object[37].PropertyValue = Menu_Achievements
			Object[38].PropertyValue = Menu_LeaderBoards
			Object[39].PropertyValue = Menu_Help&Options
			Object[40].PropertyValue = Menu_Soundtrack
			Object[41].PropertyValue = Menu_UnlockFullGame
			Object.ButtonCount = 8
		else
			Object[34].PropertyValue = Menu_LoadSaveMenu
			Object[35].PropertyValue = Menu_ModSettings
			Object[36].PropertyValue = Menu_TimeAttack
			Object[37].PropertyValue = Menu_Achievements
			Object[38].PropertyValue = Menu_LeaderBoards
			Object[39].PropertyValue = Menu_Help&Options
			Object[40].PropertyValue = Menu_Soundtrack
			Object[41].PropertyValue = Menu_Extras
			Object.ButtonCount = 8
		end if
		break

	case RETRO_ANDROID
		if Engine.TrialMode == true
			Object[34].PropertyValue = Menu_LoadSaveMenu
			Object[35].PropertyValue = Menu_ModSettings
			Object[36].PropertyValue = Menu_Help&Options
			Object[37].PropertyValue = Menu_Soundtrack
			Object[38].PropertyValue = Menu_UnlockFullGame
			Object[39].PropertyValue = Menu_Exit
			Object.ButtonCount = 6
		else
			if Engine.OnlineActive == true
				Object[34].PropertyValue = Menu_LoadSaveMenu
				Object[35].PropertyValue = Menu_ModSettings
				Object[36].PropertyValue = Menu_TimeAttack
				Object[37].PropertyValue = Menu_LeaderBoards
				Object[38].PropertyValue = Menu_Achievements
				Object[39].PropertyValue = Menu_Help&Options
				Object[40].PropertyValue = Menu_Soundtrack
				Object[41].PropertyValue = Menu_Extras
				Object[42].PropertyValue = Menu_Exit
				Object.ButtonCount = 9
			else
				Object[34].PropertyValue = Menu_LoadSaveMenu
				Object[35].PropertyValue = Menu_ModSettings
				Object[36].PropertyValue = Menu_TimeAttack
				Object[37].PropertyValue = Menu_Help&Options
				Object[38].PropertyValue = Menu_MoreGames
				Object[39].PropertyValue = Menu_Soundtrack
				Object[40].PropertyValue = Menu_Extras
				Object[41].PropertyValue = Menu_Exit
				Object.ButtonCount = 8
				Object[38].PropertyValue = Menu_Soundtrack
				Object[39].PropertyValue = Menu_Extras
				Object[40].PropertyValue = Menu_Exit
				Object.ButtonCount = 7
			end if
		end if
		break

	case RETRO_iOS
		if Engine.OnlineActive == true
			Object[34].PropertyValue = Menu_LoadSaveMenu
			Object[35].PropertyValue = Menu_ModSettings
			Object[36].PropertyValue = Menu_TimeAttack
			Object[37].PropertyValue = Menu_LeaderBoards
			Object[38].PropertyValue = Menu_Help&Options
			Object[39].PropertyValue = Menu_Soundtrack
			Object[40].PropertyValue = Menu_Extras
			Object.ButtonCount = 7
		else
			Object[34].PropertyValue = Menu_LoadSaveMenu
			Object[35].PropertyValue = Menu_ModSettings
			Object[36].PropertyValue = Menu_TimeAttack
			Object[37].PropertyValue = Menu_Help&Options
			Object[38].PropertyValue = Menu_Soundtrack
			Object[39].PropertyValue = Menu_Extras
			Object.ButtonCount = 6
		end if
		break

	case RETRO_WP7
		if Engine.TrialMode == true
			Object[34].PropertyValue = Menu_LoadSaveMenu
			Object[35].PropertyValue = Menu_ModSettings
			Object[36].PropertyValue = Menu_Help&Options
			Object[37].PropertyValue = Menu_Soundtrack
			Object[38].PropertyValue = Menu_MoreGames
			Object[39].PropertyValue = Menu_Exit
			Object.ButtonCount = 6
		else
			if Engine.OnlineActive == true
				Object[34].PropertyValue = Menu_LoadSaveMenu
				Object[35].PropertyValue = Menu_ModSettings
				Object[36].PropertyValue = Menu_TimeAttack
				Object[37].PropertyValue = Menu_LeaderBoards
				Object[38].PropertyValue = Menu_Achievements
				Object[39].PropertyValue = Menu_Help&Options
				Object[40].PropertyValue = Menu_Soundtrack
				Object[41].PropertyValue = Menu_Extras
				Object[42].PropertyValue = Menu_Exit
				Object.ButtonCount = 9
			else
				Object[34].PropertyValue = Menu_LoadSaveMenu
				Object[35].PropertyValue = Menu_ModSettings
				Object[36].PropertyValue = Menu_TimeAttack
				Object[37].PropertyValue = Menu_Help&Options
				Object[38].PropertyValue = Menu_MoreGames
				Object[39].PropertyValue = Menu_Soundtrack
				Object[40].PropertyValue = Menu_Extras
				Object[41].PropertyValue = Menu_Exit
				Object.ButtonCount = 8
			end if
		end if
		break

	end switch

	ArrayPos0  = 34
	TempValue0 = 0
	while TempValue0 < Object.ButtonCount
		Object[ArrayPos0].ButtonYPos = TempValue0
		Object[ArrayPos0].ButtonYPos++
		ArrayPos0++
		TempValue0++
	loop

	while TempValue0 < 9
		Object[ArrayPos0].Type = TypeName[Blank Object]
		ArrayPos0++
		TempValue0++
	loop

	Object.DragLimit   = Object.ButtonCount
	Object.DragLimit  *= -30
	Object.DragLimit <<= 8

	SpriteFrame(0, -10, 144, 21, 259, 71)	// #0 - Button

	TempValue0 = 0
	TempValue1 = 18

	// (#1 - #2) - Start Game, Time Attack
	while TempValue0 < 2
		SpriteFrame(19, -7, 128, 16, 1, TempValue1)
		TempValue1 += 17
		TempValue0++
	loop

	// #3 - Achievements/ Trophies
	switch Engine.PlatformID
	case RETRO_WIN
	case RETRO_ANDROID
		switch Engine.Language
		case LANG_ENGLISH
		case LANG_FRENCH
		case LANG_SPANISH
		case LANG_JAPANESE
			SpriteFrame(19, -7, 128, 16, 1, TempValue1)
			break

		case LANG_ITALIAN
		case LANG_DEUTSCH
			SpriteFrame(19, -7, 128, 16, 1, 770)
			break

		end switch
		break

	case RETRO_PS3
		SpriteFrame(19, -7, 128, 16, 1, 513)
		break

	case RETRO_XBOX_360
	case RETRO_iOS
	case RETRO_ANDROID
	case RETRO_WP7
		SpriteFrame(19, -7, 128, 16, 1, TempValue1)
		break

	end switch

	TempValue1 += 17
	TempValue0++

	// #4 - Leaderboards
	if Engine.OnlineActive == false
		SpriteFrame(19, -7, 128, 16, 130, 460)
	else
		SpriteFrame(19, -7, 128, 16, 1, TempValue1)
	end if

	TempValue1 += 17
	TempValue0++

	// (#5 - #6) - Help & Options, Extras
	while TempValue0 < 6
		SpriteFrame(19, -7, 128, 16, 1, TempValue1)
		TempValue1 += 17
		TempValue0++
	loop

	TempValue0 = 0
	TempValue1 = 547

	// (#7 - #10) - Remove Ads(Mobile)/Unlock Full Game(Console), Unlock Full Game(Mobile)/Return to Arcade(Xbox), Exit Game, Soundtrack
	while TempValue0 < 4
		SpriteFrame(19, -7, 128, 16, 1, TempValue1)
		TempValue1 += 17
		TempValue0++
	loop

	SpriteFrame(19, -7, 128, 16, 162, 649)	// #11 - More Games
	SpriteFrame(19, -7, 128, 16, 1, 770)	// #12 - Mod Settings

	// Highlight Text
	TempValue0 = 0
	TempValue1 = 18

	// (#12 - #13 Standard, #13 - #14 Mobile) - Start Game, Time Attack
	while TempValue0 < 2
		SpriteFrame(19, -7, 128, 16, 130, TempValue1)
		TempValue1 += 17
		TempValue0++
	loop

	if Engine.PlatformID == RETRO_PS3
		SpriteFrame(19, -7, 128, 16, 130, 513)
	else
		if Engine.PlatformID != RETRO_IOS
			SpriteFrame(19, -7, 128, 16, 130, TempValue1)
		else
			SpriteFrame(19, -7, 128, 16, 291, 632)
		end if
	end if

	TempValue1 += 17
	TempValue0++

	// (#15 - #17 Standard, #16 - #18 Mobile) - Leaderboards, Help & Options, Extras
	while TempValue0 < 6
		SpriteFrame(19, -7, 128, 16, 130, TempValue1)
		TempValue1 += 17
		TempValue0++
	loop

	TempValue0 = 0
	TempValue1 = 547

	// (#18 - #21 Standard, #19 - #22 Mobile) - Remove Ads(Mobile)/Unlock Full Game(Console), Unlock Full Game(Mobile)/Return to Arcade(Xbox), Exit Game, Soundtrack
	while TempValue0 < 4
		SpriteFrame(19, -7, 128, 16, 130, TempValue1)
		TempValue1 += 17
		TempValue0++
	loop

	SpriteFrame(19, -7, 128, 16, 162, 666) 	// #23 - More Games
	SpriteFrame(19, -7, 128, 16, 130, 770)	// #24 - Mod Settings
	
#platform: Use_Origins
	if game.mainMenuMode != MAINMENUMODE_NONE
		Object[34].State  = MENUBUTTON_BUTTONS_OUT
		Object[34].Timer = 0
		Object[35].State = MENUBUTTON_BUTTONS_OUT
		Object[35].Timer = 0
		Object[36].State = MENUBUTTON_BUTTONS_OUT
		Object[36].Timer = 0
		Object[37].State = MENUBUTTON_BUTTONS_OUT
		Object[37].Timer = 0
		Object[38].State = MENUBUTTON_BUTTONS_OUT
		Object[38].Timer = 0
		Object[39].State = MENUBUTTON_BUTTONS_OUT
		Object[39].Timer = 0
		Object[40].State = MENUBUTTON_BUTTONS_OUT
		Object[40].Timer = 0
		Object[41].State = MENUBUTTON_BUTTONS_OUT
		Object[41].Timer = 0
		Object[42].State = MENUBUTTON_BUTTONS_OUT
		Object[42].Timer = 0
		Object[43].State = MENUBUTTON_BUTTONS_OUT
		Object[43].Timer = 0

		if game.mainMenuMode == MAINMENUMODE_VISUALMODE
			MenuHeading.State  = MENUHEADING_IDLE
			MenuHeading.Header = EXTRAS_HEADER

			CallFunction(MenuButton_SetupMenuWindow)
			ResetObjectEntity(62, TypeName[ExtrasMenu], 0, 0, 0)
			Object.NextMenuInkEffect = INK_ALPHA
			Object.NextMenuAlpha	 = 0

			ResetObjectEntity(63, TypeName[Blank Object], 0, 0, 0)
			ResetObjectEntity(64, TypeName[Blank Object], 0, 0, 0)
			ResetObjectEntity(65, TypeName[Blank Object], 0, 0, 0)
			ResetObjectEntity(66, TypeName[Blank Object], 0, 0, 0)
			Object.Type = TypeName[Blank Object]
		else
			if game.mainMenuMode == MAINMENUMODE_SOUNDTRACK
				MenuHeading.State  = MENUHEADING_IDLE
				MenuHeading.Header = SOUNDTRACK_HEADER

				CallFunction(MenuButton_SetupMenuWindow)
				MenuWindow.State = MENUWINDOW_SOUNDTRACK_EXPAND
				ResetObjectEntity(62,TypeName[Soundtrack Menu], 0, 0, 0)

				Object.NextMenuInkEffect = INK_ALPHA
				Object.NextMenuAlpha	 = 0

				ResetObjectEntity(63, TypeName[Blank Object], 0, 0, 0)
				ResetObjectEntity(64, TypeName[Blank Object], 0, 0, 0)
				ResetObjectEntity(65, TypeName[Blank Object], 0, 0, 0)
				ResetObjectEntity(66, TypeName[Blank Object], 0, 0, 0)
				Object.Type = TypeName[Blank Object]
			else
				if game.mainMenuMode == MAINMENUMODE_CHARASELECT
					MenuHeading.State  = MENUHEADING_IDLE
					MenuHeading.Header = SAVESELECT_HEADER

					CallFunction(MenuButton_SetupMenuWindow)
					ResetObjectEntity(62,TypeName[Load Save Menu], 0, 0, 0)

					Object.NextMenuInkEffect = INK_ALPHA
					Object.NextMenuAlpha	 = 0
					
					ResetObjectEntity(63, TypeName[Blank Object], 0, 0, 0)
					ResetObjectEntity(64, TypeName[Blank Object], 0, 0, 0)
					ResetObjectEntity(65, TypeName[Blank Object], 0, 0, 0)
					ResetObjectEntity(66, TypeName[Blank Object], 0, 0, 0)
					Object.Type = TypeName[Blank Object]
				else
					if game.mainMenuMode == MAINMENUMODE_HELPOPTION
						MenuHeading.State  = MENUHEADING_LEAVE_SCREEN
						MenuHeading.Header = HELP&OPTIONS_HEADER

						CallFunction(MenuButton_SetupMenuWindow)
						if Options.DevMenuFlag == true
							ResetObjectEntity(62,TypeName[Options Menu H], 0, 0, 0)
						else
							ResetObjectEntity(62,TypeName[Options Menu], 0, 0, 0)
						end if

						Object.NextMenuInkEffect = INK_ALPHA
						Object.NextMenuAlpha	 = 0
						
						ResetObjectEntity(63, TypeName[Blank Object], 0, 0, 0)
						ResetObjectEntity(64, TypeName[Blank Object], 0, 0, 0)
						ResetObjectEntity(65, TypeName[Blank Object], 0, 0, 0)
						ResetObjectEntity(66, TypeName[Blank Object], 0, 0, 0)
						Object.Type = TypeName[Blank Object]
					else
						if game.mainMenuMode == MAINMENUMODE_EXTRAS
							MenuHeading.State = MENUHEADING_LEAVE_SCREEN
							MenuHeading.Header = EXTRAS_HEADER

							CallFunction(MenuButton_SetupMenuWindow)
							ResetObjectEntity(62,TypeName[Extras Menu], 0, 0, 0)

							Object.NextMenuInkEffect = INK_ALPHA
							Object.NextMenuAlpha = 0

							ResetObjectEntity(63, TypeName[Blank Object], 0, 0, 0)
							ResetObjectEntity(64, TypeName[Blank Object], 0, 0, 0)
							ResetObjectEntity(65, TypeName[Blank Object], 0, 0, 0)
							ResetObjectEntity(66, TypeName[Blank Object], 0, 0, 0)
							Object.Type = TypeName[Blank Object]
						else
							if game.mainMenuMode == MAINMENUMODE_SETTINGS
								MenuHeading.State  = MENUHEADING_LEAVE_SCREEN
								MenuHeading.Header = HELP&OPTIONS_HEADER

								CallFunction(MenuButton_SetupMenuWindow)
								ResetObjectEntity(62,TypeName[Options Menu], 0, 0, 0)

								Object.NextMenuInkEffect = INK_ALPHA
								Object.NextMenuAlpha	 = 0

								ResetObjectEntity(63, TypeName[Blank Object], 0, 0, 0)
								ResetObjectEntity(64, TypeName[Blank Object], 0, 0, 0)
								ResetObjectEntity(65, TypeName[Blank Object], 0, 0, 0)
								ResetObjectEntity(66, TypeName[Blank Object], 0, 0, 0)
								Object.Type = TypeName[Blank Object]
							else
								if game.mainMenuMode == MAINMENUMODE_MODSETTINGS
									MenuHeading.State = MENUHEADING_LEAVE_SCREEN
									MenuHeading.Header = MODSETTINGS_HEADER

									CallFunction(MenuButton_SetupMenuWindow)
									ResetObjectEntity(62, TypeName[Mod Settings Menu], 0, 0, 0)

									Object.NextMenuInkEffect = INK_ALPHA
									Object.NextMenuAlpha = 0

									ResetObjectEntity(63, TypeName[Blank Object], 0, 0, 0)
									ResetObjectEntity(64, TypeName[Blank Object], 0, 0, 0)
									ResetObjectEntity(65, TypeName[Blank Object], 0, 0, 0)
									ResetObjectEntity(66, TypeName[Blank Object], 0, 0, 0)
									Object.Type = TypeName[Blank Object]
								end if
							end if
						end if
					end if
				end if
			end if
		end if
	end if

#endplatform

end sub


// ========================
// Editor Subs
// ========================

sub RSDKEdit
	if Editor.ReturnVariable == true
		switch Editor.VariableID
		case EDIT_VAR_PROPVAL // Property Value
			CheckResult = Object.PropertyValue
			break
		case 0 // Type
			CheckResult = Object.PropertyValue
			break
		end switch
	else
		switch Editor.VariableID
		case EDIT_VAR_PROPVAL // Property Value
			Object.PropertyValue = Editor.VariableValue
			break
		case 0 // Type
			Object.PropertyValue = Editor.VariableValue
			break
		end switch
	end if
end sub


sub RSDKDraw
	DrawSprite(0)
end sub


sub RSDKLoad
	LoadSpriteSheet("Menu/MenuGfx2_EN.gif")
	SpriteFrame(0, -10, 144, 21, 259, 71)	// #0 - Button

	// These are overwritten in ObjectStartup but its cool to see anyways
	AddEditorVariable("Type")
	SetActiveVariable("Type")
	AddEnumVariable("None", 0)
	AddEnumVariable("Play", 1)
	AddEnumVariable("Time Attack", 2)
	AddEnumVariable("Leaderboards", 3)
	AddEnumVariable("Achievements", 4)
	AddEnumVariable("Help & Options", 5)
	AddEnumVariable("Extras", 6)
	AddEnumVariable("Unlock Full Game", 7)
	AddEnumVariable("Store", 8)
	AddEnumVariable("Exit", 9)
	AddEnumVariable("Soundtrack", 10)
	AddEnumVariable("MoreGames", 11)
	AddEnumVariable("Mod Settings", 12)
end sub
